package cate.game.play.skill.passive.god;

import cate.common.table.d.GDPlay;
import cate.common.table.d.GDSkill;
import cate.game.play.config.PlayCfgArgs;
import cate.game.play.fighter.Fighter;
import cate.game.play.proce.action.ctx.ActionCtx;
import cate.game.play.skill.passive.PassiveHandler;
import easy.java.struct.ref.DoubleRef;

/**
 * 受到负面状态的伤害和真实伤害减少35%，自身伤害减免提升16%
 */
public class 金刚不坏PH extends PassiveHandler {

	private double 系数;

	//系数=3500
	@Override
	public void parse(String code) {
		PlayCfgArgs args = new PlayCfgArgs(code);
		系数 = args.getWDouble("系数", 0d);
	}

	@Override
	public void adjustDamage(ActionCtx action, Fighter actor, byte nature, int reason, DoubleRef doubleRef) {
		if (nature == GDSkill.Nature.REAL || reason == GDPlay.HpReason.BUFF) {
			doubleRef.v *= (1 - 系数);
		}
	}
}
